/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javaseapp - Reg1
 * <p>Powered by webrx On 2021-08-06 16:14:25
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Reg7 {
    public static void main(String[] args) {
        String str = "fah";

        // ^.{1,}$   ^.+$
        //String pattern = "^.+$";  //. 代表一个任意字符， + 代表{1,} 代表它前边符号出现的1个或多个

        // ^..?$   相当于 ^..{0,1}$
        //String pattern = "^..?$";//  ? a? 匹配 0个a 或1个a  ""  "a"

        //cdef  + {1,}
        String pattern = "^[c-f]+$";
        pattern = "^[a-zA-Z0-9]{6,18}$";

        //* {0,n}
        pattern = "^[a-fh]*$";
        System.out.println(str.matches(pattern));
    }
}
